package com.tang.generate.service.impl;

import com.github.yulichang.base.MPJBaseServiceImpl;

import com.tang.generate.domain.GenFieldType;
import com.tang.generate.mapper.GenFieldTypeMapper;
import com.tang.generate.service.IGenFieldTypeService;
import org.springframework.stereotype.Service;

import java.util.Objects;


@Service
public class GenFieldTypeServiceImpl extends MPJBaseServiceImpl<GenFieldTypeMapper, GenFieldType> implements IGenFieldTypeService {


    @Override
    public String getImportByName(String name) {
        GenFieldType fieldType = lambdaQuery()
                .eq(GenFieldType::getName, name)
                .one();
        if (Objects.isNull(fieldType)) {
            return "";
        }
        return fieldType.getImportStr();
    }
}
